home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BMUG Revelations
/
BMUG Revelations.toast
/
Utilities
/
Random
/
Commodore 64c
/
SOURCE
/
Tape.c
< prev
next >
Wrap
Text File
|
1994-03-19
|
1KB
|
48 lines
/*
Commodore 64 Emulator v0.2 Earle F. Philhower III
Copyright (C) 1993-4 (st916w9r@dunx1.ocs.drexel.edu)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "ProcessorTypes.h"
#include "Memory.h"
void LoadTapeFS(FSSpec *spec)
{
short fNum;
unsigned long len;
byte data;
word addr;
FSpOpenDF(spec, fsRdPerm, &fNum);
SetFPos(fNum, fsFromStart, 0x42);
len=1; FSRead(fNum, &len, &data); addr=data;
len=1; FSRead(fNum, &len, &data); addr+=((word)data)<<8;
SetFPos(fNum, fsFromStart, 0x0400);
len=1;
while (len) FSRead(fNum, &len, &(RAM[addr++]));
FSClose(fNum);
}
void LoadTape(void)
{
static StandardFileReply reply;
StandardGetFile(nil, (short)-1, nil, &reply);
if (reply.sfGood) LoadTapeFS(&reply.sfFile);
}